package com.ygsj.broadcast;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

import com.ygsj.Utils.UHFUtils;


/*全局检测网络状态变化简单进行提示*/
public class NetChangeReceiver extends BroadcastReceiver {
  //  public static final  String ACTION = "com.gasplatform.ygsj.mashgasmonitoring.broadcast.NetChangeReceiver";
    @Override
    public void onReceive(Context context, Intent intent) {
        UHFUtils uhfUtil = UHFUtils.getInstance();
        Boolean isConnect =  uhfUtil.isNetworkAvailable(context);
        if (!isConnect){
            Toast.makeText(context, "网络中断,请检查网络设置", Toast.LENGTH_SHORT).show();
        }
        //throw new UnsupportedOperationException("Not yet implemented");

    }


}
